﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace YJTMedicalAideManage.Cores.Converters
{
    public class TextTrimmingToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // 判断 TextTrimming 是否为 CharacterEllipsis 或其他截断条件
            if (value != null && value.ToString().Length < 11)
            {
                return Visibility.Visible; // 只有文本被截断时才显示 ToolTip
            }
            return Visibility.Collapsed; // 否则不显示
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
